package lesson14;

public class Person 
{
	String name;
	int age;
	String personalNumber;
	char sex;
	double weight;
	Person friend;
	int carsOwned = 0;
	
	int hungerStatus = 50;
	int healthStatus = 50;
	int mentalStatus = 50;
	
	void eat(int foodCalories)
	{
		if (hungerStatus + foodCalories >= 100)
			hungerStatus = 100;
		else
			hungerStatus += foodCalories;
	}
	
	void walk()
	{
		System.out.println(name + "is walking");
		hungerStatus -= 5;
	}
	
	void growUp()
	{
		age++;
	}
	
	void drinkWater(double litres)
	{
		hungerStatus += litres;
	}
	
	void buyACar(Car car)
	{
		carsOwned++;
		car.owner = this;
	}
	
	boolean wantToBuy()
	{
		
		int random = (int)Math.round(Math.random() + 1);
		boolean wantToBuy = false;
		if (random == 1 && carsOwned < 2)
		{
			wantToBuy = true;
		}
		
		return wantToBuy;
	}
	
}
